package org.mct.mes.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.mct.mes.entity.MesRawData2;
import org.mct.mes.mapper.MesRawData2Mapper;
import org.mct.mes.service.MesRawData2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.Instant;
import java.util.List;

@Service
public class MesRawData2ServiceImpl implements MesRawData2Service {
    @Autowired
    MesRawData2Mapper mesRawData2Mapper;
    @Override
    public PageInfo<MesRawData2> query10(int pageNum, int pageSize, String device_code, Instant queryTimeStart, Instant queryTimeEnd) {
        System.err.println("impl"+queryTimeEnd+" "+queryTimeStart);
//        // 启动分页
        PageHelper.startPage(pageNum,pageSize);
        List<MesRawData2> mesRawData2s = mesRawData2Mapper.query10(device_code,queryTimeStart,queryTimeEnd);
        return new PageInfo<>(mesRawData2s);
    }

    @Override
    public int addOne(MesRawData2 mesRawData2) {
        return  mesRawData2Mapper.addOne(mesRawData2);
    }
}
